
from celery_tasks.main import celery_app
from utils.smsutils import SmsUtil

import logging
from django.conf import settings
from django.core.mail import send_mail
from celery_tasks.main import celery_app

logger = logging.getLogger('django')

# name：异步任务别名
@celery_app.task(name='send_sms_code')
def send_sms_code(mobile, sms_code):
    """
    发送短信异步任务
    :param mobile: 手机号
    :param sms_code: 短信验证码
    """
    SmsUtil().send_message(mobile=mobile, code=sms_code)

